import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import ClIcon from "./ClIcon.vue";
import ClIconSelect from "./ClIconSelect.vue";
export { ClIcon, ClIconSelect };
export default {
  name: 'cl-icon-selcect',
  install: (app, options = {}) => {
    // 两个组件各自的props默认参数，可在全局注册的时候进行修改
    let ClIconOptoin = ["size", "color", "iconSymbolPrefix"];
    let ClIconSelectOption = [
      "placeholder",
      "activeColor",
      "iconSize",
      "maxHeight",
      "iconShow",
      "useIconMethod",
      "customIconList",
      "autoClose",
      "beforeClose",
      "beforeGetIcon",
      "iconFontUrl",
      "loadIconUrlOk",
      "loadIconUrlFail",
    ];
    for (const key in options) {
      if (Object.prototype.hasOwnProperty.call(options, key)) {
        const value = options[key];
        if (ClIconOptoin.includes(key)) {
          ClIcon.props[key]["default"] = value;
        }
        if (ClIconSelectOption.includes(key)) {
          ClIconSelect.props[key]["default"] = value;
        }
      }
    }
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component);
    }
    app.component("ClIcon", ClIcon);
    app.component("ClIconSelect", ClIconSelect);
  },
};
